

<script>
	import websocketManager from '@/websocketService.js';
	import uploadurl from "@/config/index.js"
export default {
  data() {
    return {
      isBackground: false, // 标志位，默认为false表示前台
    };
  },

  onHide() {
    this.isBackground = true;
    console.log('应用进入了后台');
    // 执行其他后台逻辑
  },

  onShow() {
	  if(this.$store.state.id!==''){
		  websocketManager.init(`ws://${uploadurl.WS}?${this.$store.state.id}`);
		  this.isBackground = false;
		  console.log('应用从前台恢复或启动');
	  }
    // 执行其他前台逻辑
  }
}
</script>

<style>
/* 全局样式 */
</style>